package com.ocom.xcxapi.controller;

import com.google.zxing.WriterException;
import com.ocom.common.constant.CompanyServiceUrl;
import com.ocom.common.resp.Result;
import com.ocom.xcxapi.service.AccessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;


@PreAuthorize("hasRole('ROLE_XCX')")
@RestController
public class MenjinController {

	@Autowired
	private AccessService accessService;

	/**
	 * 2.7.获取二维码 menjin/getCode
	 * */
	@GetMapping(CompanyServiceUrl.URL_MenjinGetCode)
	public Result MenjinGetCode(Long comId, Long pId) throws IOException, WriterException {
//		YoCiUser yoCiUser= SecurityUtils.getYoCiUser();
//		return accessService.MenjinGetCode(yoCiUser.getComId(),yoCiUser.getId());
		return accessService.MenjinGetCode(comId,pId);
	}
}
